#ifndef GAMEWIDGET_H
#define GAMEWIDGET_H

#include <QDialog>
#include <QList>
#include <QLineEdit>
#include <QPushButton>
#include <QSet>
#include <QSettings>
#include "gamecore.h"

namespace Ui {
class GameWidget;
}

class GameWidget : public QDialog
{
    Q_OBJECT

public:
    explicit GameWidget(QWidget *parent = 0);
    ~GameWidget();
    void paintEvent(QPaintEvent *event);
    void initWsVec();
    void initButtonsVec();
    void clearWs();
    void clearButtons();
    void setUiWord(QString words);
    bool addAWords(QString words);
    void showQuestion();
    QString getText();

    bool eventFilter(QObject *obj, QEvent *ev);
    void resizeEvent(QResizeEvent *);
    void closeEvent(QCloseEvent *e);

private slots:
    void on_nextQuestion_clicked();

    void on_backSpace_clicked();

private:
    Ui::GameWidget *ui;

    QList<QPushButton*> buttonsList;
    QList<QLineEdit*> wsList;
    GameCore core;
    QSettings st;
};

#endif // GAMEWIDGET_H
